package com.ruanhb.wsp.controller;

import com.ruanhb.wsp.service.WeatherDataService;
import com.ruanhb.wsp.vo.BaseResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by r on 2018-9-21
 */
@RequestMapping("weather")
@RestController
public class WeatherController {

    @Autowired
    private WeatherDataService weatherDataService;


    @GetMapping("/cityId/{cityId}")
    public BaseResponse getWeatherByCityId(@PathVariable("cityId") String cityId){
        return weatherDataService.getWeatherDataByCityId(cityId);
    }
}
